import http from "@/api/axios";

//保险订单-待下单-tab值为0
export const waitOrderPageDataApi = (data: PlaceOrder.SearchParams) => {
  return http({
    method: "post",
    url: "/base/biz/insuranceShipmentOrder/waitOrderPageData",
    data
  });
};

//保险订单-已下单-tab值为1.待审核 2.审核通过 3.驳回 4.取消
export const insuranceShipmentOrderApi = (data: PlaceOrder.SearchParams) => {
  return http({
    method: "post",
    url: "/base/biz/insuranceShipmentOrder/pageData",
    data
  });
};

//保险订单-已下单-tab值为1.待审核 2.审核通过 3.驳回 4.取消
export const insuranceShipmentOrderPageStatApi = (data: PlaceOrder.SearchParams) => {
  return http({
    method: "post",
    url: "/base/biz/insuranceShipmentOrder/pageStat",
    data
  });
};

//保险订单-下单
export const saveOrderApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/insuranceShipmentOrder/saveOrder",
    data
  });
};

//保险订单-导入下单
export const importOrderApi = (formData: FormData) => {
  return http({
    method: "post",
    url: "/base/biz/insuranceShipmentOrder/importOrder",
    data: formData,
    headers: {
      "Content-type": "multipart/form-data"
    }
  });
};

//保险订单-取消
export const cancelOrderApi = (data: Array<string>) => {
  return http({
    method: "post",
    url: "/base/biz/insuranceShipmentOrder/cancelOrder",
    data
  });
};

//保险订单-修改保险单备注
export const updateRemarkApi = (data: { id: string; insuranceRemark: string }) => {
  return http({
    method: "post",
    url: "/base/biz/insuranceShipmentOrder/updateRemark",
    data
  });
};

//保险订单-详情
export const getDetailkApi = (id: string) => {
  return http({
    method: "get",
    url: `/base/biz/insuranceShipmentOrder/getDetail/${id}`
  });
};

//保险订单-修改保险单
export const updateOrderApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `/base/biz/insuranceShipmentOrder/updateOrder`,
    data
  });
};

//保险订单-修改保险单
export const getInsuranceOrderFileApi = (id: string) => {
  return http({
    method: "get",
    url: `/base/biz/insuranceShipmentOrder/getInsuranceOrderFile/${id}`
  });
};
